package cn.zymall.chat.controller;

import cn.zymall.common.feign.fastFile.FastFileFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author xuxianda
 * @Description: 测试文件上传
 * @date 2020/8/23 11:54
 * @Copyright
 * @return
 **/
@RestController
@RequestMapping("/upload")
public class UploadController {

    @Autowired
    FastFileFeign fastFileFeign;

    @PostMapping
    public String upload(@RequestPart(value = "file") MultipartFile file) {
        System.out.println(file.getOriginalFilename());
        return fastFileFeign.uploadMethod(file);
    }

}
